package com.joyintech.enums;

/**
 * 产品类型枚举  产品类型(01,存款\02,理财\03,基金\04,保险\05,贵金属\06,资管计划)
 */
public enum ProductTypeEnum {

    FC("02","理财"),
    PRECIOUS_METAL("05","贵金属"),
    BIL("04","银保通"),
    FUND("03","基金"),
    AM("06","资管"),
    DEPOSIT("01","存款"),
    ;

    private String productType;
    private String productName;

    ProductTypeEnum(String serviceId, String serviceName) {
        this.productType = serviceId;
        this.productName = serviceName;
    }

    public String getProductType() {
        return productType;
    }

    public String getProductName() {
        return productName;
    }

    public static ProductTypeEnum getNameByCode(String code) {
        for (ProductTypeEnum codeEnum : ProductTypeEnum.values()) {
            if (codeEnum.getProductType().equals(code)) {
                return codeEnum;
            }
        }
        return null;
    }
}
